package com.william.jdbcplus.test.entity;

import com.william.jdbcplus.common.annotation.*;
import com.william.jdbcplus.common.entity.Entity;
import com.william.jdbcplus.common.enums.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;

@Data
@Table("db_demo")
@ApiModel("实例表")
public class DbDemo implements Entity {
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", remarks = "主键", type = IdType.GUID)
    private String id;

    @TableColumn(remarks = "非空", size = 30, nullable = false)
    @TableIndex
    private String notNull;

    @TableColumn(remarks = "整数", size = 30, nullable = false)
    private Integer num;

    @TableColumn(remarks = "整数或空", size = 30)
    private Integer numOrNull;

    @TableColumn(remarks = "小数", size = 30, digits = 4, nullable = false)
    private Double isDecimal;

    @TableColumn(remarks = "小数或空", size = 30, digits = 4)
    private Double decimalOrNull;

    @TableColumn(remarks = "英文字符串", size = 40, nullable = false)
    private String englishStr;

    @TableColumn(remarks = "英文字符串或空", size = 40)
    private String englishStrOrNull;

    @TableColumn(remarks = "中文字符串", size = 40, nullable = false)
    private String chineseStr;

    @TableColumn(remarks = "中文字符串或空", size = 40)
    private String chineseStrOrNull;

    @TableColumn(remarks = "邮箱", size = 40)
    @TableUk
    private String email;

    @TableColumn(remarks = "邮箱或空", size = 40)
    private String emailOrNull;

    @TableColumn(remarks = "电话", size = 20, nullable = false)
    @TableUk
    private String phone;

    @TableColumn(remarks = "电话或空", size = 20)
    private String phoneOrNull;

    @TableColumn(remarks = "时间非空", size = 20, nullable = false)
    private Date dateTime;

    @TableColumn(remarks = "时间或空", size = 20)
    private Date dateTimeOrNull;

    @TableColumn(remarks = "是否隐藏", size = 1)
    private Boolean hidden;

    @TableColumn(remarks = "长整数", size = 20)
    private Long numLong;

    @TableColumn(remarks = "双精度", size = 20, digits = 5)
    private Double numDouble;

    @TableColumn(remarks = "双精度", size = 12, digits = 2)
    private Double numFloat;

    @TableColumn(remarks = "大整数", size = 30)
    private BigInteger bigInteger;

    @TableColumn(remarks = "大小数", size = 40, digits = 7)
    private BigDecimal bigDecimal;

    @TableColumn(remarks = "文本", size = 10000)
    private String text;
}
